package com.biz.primus.ms.order.service.bulider;

import com.biz.primus.base.exception.BizSilentException;
import com.biz.primus.base.exception.utils.AssertUtils;
import com.biz.primus.common.utils.DateUtil;
import com.biz.primus.common.utils.StringUtil;
import com.biz.primus.model.depot.vo.DepotRespVo;
import com.biz.primus.model.order.enums.DeliveryType;
import com.biz.primus.model.order.enums.OrderPaymentWay;
import com.biz.primus.model.order.enums.OrderType;
import com.biz.primus.model.order.exception.OrderException;
import com.biz.primus.model.order.exception.utils.AssertRequestParameter;
import com.biz.primus.model.order.vo.*;
import com.biz.primus.model.order.vo.OrderPromotionVO;
import com.biz.primus.model.order.vo.request.OrderRequestVO;
import com.biz.primus.model.order.vo.request.OrderSummaryRequestVO;
import com.biz.primus.model.order.vo.response.OrderSummaryResponseVO;
import com.biz.primus.model.promotion.vo.OrderPromotionDetailVo;
import com.biz.primus.model.promotion.vo.resp.OrderPromotionRespItemVo;
import com.biz.primus.model.promotion.vo.resp.OrderPromotionRespVo;
import com.biz.primus.ms.order.convertor.OrderDeliveryInfoConvertor;
import com.biz.primus.ms.order.convertor.OrderPromotionConvertor;
import com.biz.primus.ms.order.dao.po.embeddable.OrderDeliveryInfo;
import com.biz.primus.ms.order.promotion.PromotionHandlerManager;
import com.biz.primus.ms.order.service.helper.OrderServiceHelper;
import org.codelogger.utils.BeanUtils;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 订单校验构建器,具体负责订单结算的细节<br>
 * 获取促销，优惠券
 *
 * @author Tiger Feng
 * @date 2017年11月01日
 */
public class SettleOrderBuilder {
    /**
     * 订单汇总请求视图
     */
    private OrderSummaryRequestVO orderSummaryRequestVO;
    /**
     * 订单汇总响应视图
     */
    private OrderSummaryResponseVO orderSummaryResponseVO;
    /**
     * 订单服务助手，构造方法注入
     */
    private OrderServiceHelper helper;
    private OrderType orderType;
    private OrderRequestVO storeOrderVO;
    private OrderRequestVO flagshipOrderVO;
    /**
     * 门店订单的促销列表
     */
    private List<OrderPromotionDetailVo> storeOrderPromotions;
    /**
     * 总店订单的促销列表
     */
    private List<OrderPromotionDetailVo> flagshipOrderPromotions;
    /**
     * 用户选择的促销
     */
    private OrderPromotionVO promotionRequestVO;
    /**
     * 门店信息
     */
    private DepotRespVo depot;
    /**
     * 当前订单汇总可支持的支付方式列表
     */
    private List<OrderPaymentWay> supportPaymentWays;
    /**
     * 用户选择的支付方式
     */
    private OrderPaymentWay paymentWay;

    /**
     * 禁用无参构造方法
     */
    private SettleOrderBuilder() {
    }

    /**
     * 构造方法,内部调用，禁止外部构造
     *
     * @param orderSummaryRequestVO
     * @param helper
     */
    private SettleOrderBuilder(OrderSummaryRequestVO orderSummaryRequestVO, OrderServiceHelper helper) {
        this.orderSummaryRequestVO = orderSummaryRequestVO;
        this.helper = helper;
        this.orderSummaryResponseVO = new OrderSummaryResponseVO();
        this.orderType = orderSummaryRequestVO.getOrderType();
        this.storeOrderVO = orderSummaryRequestVO.getStoreOrder();
        this.flagshipOrderVO = orderSummaryRequestVO.getFlagshipOrder();
        this.promotionRequestVO = orderSummaryRequestVO.getPromotion();
        this.paymentWay = orderSummaryRequestVO.getPaymentWay();
    }

    /**
     * 1、创建构建器
     *
     * @param orderSummaryRequestVO 订单汇总请求视图
     * @param helper                订单服务助手
     * @return
     */
    public static SettleOrderBuilder newBuilder(OrderSummaryRequestVO orderSummaryRequestVO, OrderServiceHelper helper) {
        AssertRequestParameter.notNull(orderSummaryRequestVO, "订单汇总对象不能为空");
        AssertUtils.notNull(helper, OrderException.ORDER_HELPER_CAN_NOT_NULL);
        return new SettleOrderBuilder(orderSummaryRequestVO, helper);
    }

    /**
     * 2、检查参数、准备关联数据
     *
     * @return
     */
    public SettleOrderBuilder check() {
        // 检查必备参数
        checkParameters();
        // 检查订单类型
        checkOrderType();

        // 所有的门店订单均是闪送
        if (storeOrderVO != null) {
            storeOrderVO.setIsStoreOrder(true);
            storeOrderVO.setOrderType(OrderType.flash);
        }
        // 校验商品数量是否合法
        checkProductQuantity();
        // 查询门店信息
        this.depot = helper.getDepotByCode(orderSummaryRequestVO.getDepotCode());
        AssertRequestParameter.notNull(depot, "门店不存在(depotCode:" + orderSummaryRequestVO.getDepotCode() + ")");
        orderSummaryRequestVO.setDepot(depot);
        // 补充商品信息
        helper.getProductsInfo(orderSummaryRequestVO);
        // 查询订单促销信息
        queryOrderPromotionInfo();
        return this;
    }

    /**
     * 3、处理支付方式
     *
     * @return
     */
    public SettleOrderBuilder handlePaymentWay() {
        // 返回支持的支付方式
        supportPaymentWays = helper.findSupportWays();
        if (paymentWay == null) {
            // 设置默认支付方式
            paymentWay = OrderPaymentWay.balance;
        }
        if (storeOrderVO != null) {
            storeOrderVO.setPaymentWay(paymentWay);
        }
        if (flagshipOrderVO != null) {
            flagshipOrderVO.setPaymentWay(paymentWay);
        }
        return this;
    }

    /**
     * 4、处理门店订单
     *
     * @return
     */
    public SettleOrderBuilder handleStoreOrder() {
        // 没有门店订单直接跳过
        if (this.storeOrderVO == null) {
            return this;
        }
        // 更新统计
        storeOrderVO.refreshParameter();
        return this;
    }

    /**
     * 5、处理总店订单
     *
     * @return
     */
    public SettleOrderBuilder handleFlagshipOrder() {
        // 无总店订单，跳过不处理
        if (this.flagshipOrderVO == null) {
            return this;
        }
        // 更新统计
        flagshipOrderVO.refreshParameter();
        return this;
    }

    /**
     * 6、处理促销、优惠券、物流信息
     *
     * @return
     */
    public SettleOrderBuilder handlePromotionAndDelivery() {
        // 判断 是否使用促销
        if(orderSummaryRequestVO.getUsePromotion()){
            // 处理促销
            handlePromotion();
        }
        // 优惠券

        // 门店订单物流
        handleStoreOrderDelivery();
        // 总店订单物流
        handleFlagshipOrderDelivery();
        return this;
    }

    /**
     * 7、返回订单汇总响应视图
     *
     * @return
     */
    public OrderSummaryResponseVO build() {
        BeanUtils.copyProperties(orderSummaryRequestVO, orderSummaryResponseVO);
        // 支持的支付方式
        orderSummaryResponseVO.setSupportPaymentWays(supportPaymentWays);
        // 绑定支付方式
        if (orderSummaryResponseVO.getStoreOrder() != null) {
            orderSummaryResponseVO.getStoreOrder().setPaymentWay(this.paymentWay);
        }
        if (orderSummaryResponseVO.getFlagshipOrder() != null) {
            orderSummaryResponseVO.getFlagshipOrder().setPaymentWay(this.paymentWay);
        }
        return orderSummaryResponseVO;
    }

    /***************************************************
     * 内部私有方法
     ***************************************************/
    private String getTimeStr() {
        return DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now());
    }

    private void checkParameters() {
        // 校验订单类型(闪送、商城、秒杀、同步)
        AssertRequestParameter.notNull(orderType, "订单类型不能为空");
        // 校验用户信息
        AssertRequestParameter.notNull(orderSummaryRequestVO.getUserId(), "用户编号不能为空");
        // 门店信息
        AssertRequestParameter.notNull(orderSummaryRequestVO.getDepotCode(), "门店编码不能为空");
        // 校验收货地址信息
        AssertRequestParameter.notNull(orderSummaryRequestVO.getConsignee(), "收货地址经纬度不能为空");
        AssertRequestParameter.notNull(orderSummaryRequestVO.getConsignee().getConsigneeLat(), "收货地址纬度不能为空");
        AssertRequestParameter.notNull(orderSummaryRequestVO.getConsignee().getConsigneeLon(), "收货地址经度不能为空");
        // 初始化汇总编码和订单编码
        if (StringUtil.isNullOrEmpty(orderSummaryRequestVO.getOrderSummaryCode())) {
            orderSummaryRequestVO.setOrderSummaryCode("S" + helper.getNextId() + "T" + getTimeStr());
        }
    }

    private void checkOrderType() {
        // 订单类型和订单数据是否正确
        switch (orderType) {
            case flash:
                // 闪送模式
                AssertRequestParameter.notNull(storeOrderVO, "闪送模式，门店订单不能为空");
                AssertRequestParameter.isNull(flagshipOrderVO, "闪送模式，不能有总店订单");
                break;
            case store:
                // 商城
                if (flagshipOrderVO != null) {
                    flagshipOrderVO.setIsStoreOrder(false);
                    flagshipOrderVO.setOrderType(orderType);
                }
                break;
            case seckill:
                // 秒杀
                AssertRequestParameter.isNull(storeOrderVO, "秒杀模式，不能有门店订单");
                AssertRequestParameter.notNull(flagshipOrderVO, "秒杀模式，总店订单不能为空");
                flagshipOrderVO.setOrderType(orderType);
            default:
                throw new BizSilentException(OrderException.ORDER_TYPE_ERROR);
        }
        if (storeOrderVO != null && StringUtil.isNullOrEmpty(storeOrderVO.getOrderCode())) {
            storeOrderVO.setOrderCode(
                    storeOrderVO.getOrderType().getOrderCodePrefix() +
                            helper.getNextId() +
                            "T" +
                            getTimeStr());
        }
        if (flagshipOrderVO != null && StringUtil.isNullOrEmpty(flagshipOrderVO.getOrderCode())) {
            flagshipOrderVO.setOrderCode(
                    flagshipOrderVO.getOrderType().getOrderCodePrefix() +
                            helper.getNextId() +
                            "T" +
                            getTimeStr());
        }
    }

    /**
     * 检查商品数量是否合法，非正整数均抛出异常
     */
    private void checkProductQuantity() {
        if (orderSummaryRequestVO.getStoreOrder() != null) {
            if (orderSummaryRequestVO.getStoreOrder().getItems() != null
                    && !orderSummaryRequestVO.getStoreOrder().getItems().isEmpty()) {
                orderSummaryRequestVO
                        .getStoreOrder()
                        .getItems()
                        .stream()
                        .forEach(
                                orderItemVO -> {
                                    if (orderItemVO.getQuantity() == null
                                            || orderItemVO.getQuantity() < 1) {
                                        throw new BizSilentException(OrderException.PRODUCT_QUANTITY_ILLEGAL);
                                    }
                                }
                        );
            }
        }
        if (orderSummaryRequestVO.getFlagshipOrder() != null) {
            if (orderSummaryRequestVO.getFlagshipOrder().getItems() != null
                    && !orderSummaryRequestVO.getFlagshipOrder().getItems().isEmpty()) {
                orderSummaryRequestVO
                        .getFlagshipOrder()
                        .getItems()
                        .stream()
                        .forEach(
                                orderItemVO -> {
                                    if (orderItemVO.getQuantity() == null
                                            || orderItemVO.getQuantity() < 1) {
                                        throw new BizSilentException(OrderException.PRODUCT_QUANTITY_ILLEGAL);
                                    }
                                }
                        );
            }
        }
    }

    private void queryOrderPromotionInfo() {
        // 获取促销信息
        OrderPromotionRespVo orderPromotionRespVo = helper.getPromotion4Order(orderSummaryRequestVO);
        if (orderPromotionRespVo != null
                && orderPromotionRespVo.getOrderPromotions() != null
                && !orderPromotionRespVo.getOrderPromotions().isEmpty()) {
            for (OrderPromotionRespItemVo orderPromotionRespItemVo : orderPromotionRespVo.getOrderPromotions()) {
                // 设置门店订单的促销列表
                if (storeOrderVO.getOrderCode().equals(orderPromotionRespItemVo.getParamSeq())) {
                    this.storeOrderPromotions = orderPromotionRespItemVo.getDetails();
                }
                // 设置总店订单的促销列表
                if (flagshipOrderVO.getOrderCode().equals(orderPromotionRespItemVo.getParamSeq())) {
                    this.flagshipOrderPromotions = orderPromotionRespItemVo.getDetails();
                }
            }
        }
        // 设置默认门店促销的第一套方案
        if (this.promotionRequestVO == null && storeOrderPromotions != null && !storeOrderPromotions.isEmpty()) {
            this.promotionRequestVO = OrderPromotionConvertor.detailVO2RequestVO(storeOrderPromotions.get(0), storeOrderVO);
        }
        // 设置默认总店促销的第一套方案
        if (this.promotionRequestVO == null && flagshipOrderPromotions != null && !flagshipOrderPromotions.isEmpty()) {
            this.promotionRequestVO = OrderPromotionConvertor.detailVO2RequestVO(flagshipOrderPromotions.get(0), flagshipOrderVO);
        }
    }

    /**
     * 处理订单促销信息
     */
    private void handlePromotion() {
        // 没有促销
        if (promotionRequestVO == null) {
            return;
        }
        // 声明促销详情
        OrderPromotionDetailVo orderPromotionDetailVo = this.matchPromotion(true);
        // 如果用户选择的促销在门店订单促销
        if (orderPromotionDetailVo != null) {
            // 促销计算
            PromotionHandlerManager.execute(orderPromotionDetailVo, storeOrderVO);
        } else {
            orderPromotionDetailVo = this.matchPromotion(false);
            // 如果用户选择的促销是总店订单促销
            if (orderPromotionDetailVo != null) {
                // 促销计算
                PromotionHandlerManager.execute(orderPromotionDetailVo, flagshipOrderVO);
            } else {
                // 用户选择的促销不再门店促销和总店促销中
                throw new BizSilentException(OrderException.USER_SELECTED_PROMOTION_IS_EXIST);
            }
        }
        // 促销是否与优惠券互斥
        orderSummaryRequestVO.setCanUseDiscountCoupon(orderPromotionDetailVo.getAllowCoupon());
        orderSummaryResponseVO.setCanUseDiscountCoupon(orderPromotionDetailVo.getAllowCoupon());
    }

    /**
     * 匹配用户选择的促销详情
     *
     * @param isStoreOrder 是否匹配门店订单,flase则去总店订单选择
     * @return
     */
    private OrderPromotionDetailVo matchPromotion(boolean isStoreOrder) {
        OrderPromotionDetailVo orderPromotionDetailVo = null;
        List<OrderPromotionDetailVo> promotionDetailVos;
        OrderRequestVO orderRequestVO;
        if (isStoreOrder) {
            promotionDetailVos = storeOrderPromotions;
            orderRequestVO = storeOrderVO;
        } else {
            promotionDetailVos = flagshipOrderPromotions;
            orderRequestVO = flagshipOrderVO;
        }
        // 到门店订单促销中去匹配用户选择的促销方式
        if (promotionDetailVos != null || !promotionDetailVos.isEmpty()) {
            for (OrderPromotionDetailVo promotionDetailVo : promotionDetailVos) {
                if (promotionRequestVO.getId().longValue() == promotionDetailVo.getId()) {
                    orderPromotionDetailVo = promotionDetailVo;
                    // 当前选择的促销方式设置到门店订单中
                    orderRequestVO.setPromotion(promotionRequestVO);
                }
            }
        }
        return orderPromotionDetailVo;
    }


    /**
     * 处理门店订单物流信息
     */
    private void handleStoreOrderDelivery() {
        // 获取门店起送价格，根据门店编号
        Integer deliveryMinPrice = helper.getDeliveryMinPriceByDepotCode(depot.getDepotCode());
        // 可选择的物流方式
        List<DeliveryVO> optionalDeliveries = this.getOptionalDeliveries(true, deliveryMinPrice);
        storeOrderVO.setOptionalDeliveries(optionalDeliveries);
        // 已选择的配送方式
        DeliveryVO selectedDelivery = storeOrderVO.getSelectedDelivery();
        // 如果用户没有选择配送方式，则设置第一个配送方式为默认配送
        if (selectedDelivery == null) {
            selectedDelivery = optionalDeliveries.get(0);
        }
        // 将用户请求的配送信息转化成订单配送数据
        OrderDeliveryInfoVO deliveryInfoVO = OrderDeliveryInfoConvertor.selectedDeliveryVO2orderDeliveryInfoVO(selectedDelivery);
        if (storeOrderVO.getPayableAmount() >= deliveryMinPrice) {
            // 门店订单 && 达到起送金额
            // 同城配送、到店自提
            deliveryInfoVO.setDeliveryMoney(0);
        } else {
            // 门店订单 && 不满起送金额
            switch (selectedDelivery.getDeliverType()) {
                case THRID_TRANSPORT:
                    // 物流配送,根据第三方物流收费方式计算费用
                    deliveryInfoVO.setDeliveryMoney(22);
                    break;
                // 如果是自提，则没有物流费
                case USER_TRANSPORT:
                    deliveryInfoVO.setDeliveryMoney(0);
                default:
                    throw new BizSilentException(OrderException.NOT_SUPPORT_DELIVEY_TYPE);
            }
        }
        storeOrderVO.setSelectedDelivery(selectedDelivery);
        storeOrderVO.setDelivery(deliveryInfoVO);
    }

    /**
     * 获取支持的配送方式列表
     * <p>
     * 门店订单：\n
     * ``达到起送金额：\n
     * ````1、到店自提（可选择自提时间、选择自提地点）；\n
     * ````2、同城配送（立即送/预约送[送达时间]）；\n
     * ``不满起送金额：\n
     * ````、到店自提（可选择自提时间）；\n
     * ````2、物流配送（可选择物流公司）；\n
     * 总店订单：\n
     * ``达到起送金额：\n
     * ````1、到店自提（可选择自提时间）；\n
     * ````2、同城配送（前提：配送地址10公里范围内有门店，不能选择送达时间）/ 物流配送（可选择物流公司）；\n
     * ``不满起送金额：\n
     * ````1、到店自提（可选择自提时间，自提地点则为当前最近门店）；\n
     * ````2、物流配送（可选择物流公司）；\n
     * </p>
     *
     * @param isStoreOrder     是门店订单
     * @param deliveryMinPrice 起送价格
     * @return
     */
    private List<DeliveryVO> getOptionalDeliveries(boolean isStoreOrder, Integer deliveryMinPrice) {
        // 可选择的物流方式
        List<DeliveryVO> optionalDeliveries = new ArrayList<DeliveryVO>();
        // 门店订单
        if (isStoreOrder) {
            // 是否达到起送金额
            if (storeOrderVO.getPayableAmount() >= deliveryMinPrice) {
                // 自提
                DeliveryVO zt = new DeliveryVO();
                zt.setDeliverType(DeliveryType.USER_TRANSPORT);
                // 可以选择自提门店
                zt.setCanSelectFetchDepotCode(true);
                // 可以选择自提时间
                zt.setCanSelectFetchTime(true);

                // 同城
                DeliveryVO tc = new DeliveryVO();
                tc.setDeliverType(DeliveryType.STORE_TRANSPORT);
                // 可以预约
                tc.setCanReserve(true);
                tc.setIsReserve(false);
                // 本字段需要计算商品时效，根据时效显示
                tc.setArriveTime(new Timestamp(DateUtil.afterDays(5)));

                optionalDeliveries.add(zt);
                optionalDeliveries.add(tc);
            }
            // 不满起送金额
            else {
                // 自提
                DeliveryVO zt = new DeliveryVO();
                zt.setDeliverType(DeliveryType.USER_TRANSPORT);
                zt.setCanSelectFetchTime(true);

                // 物流
                DeliveryVO wl = new DeliveryVO();
                wl.setDeliverType(DeliveryType.THRID_TRANSPORT);
                // 可选择的物流公司
                wl.setOptionalExpresses(null);

                optionalDeliveries.add(zt);
                optionalDeliveries.add(wl);
            }
        }
        // 总店订单
        else {
            // 是否达到起送金额
            if (flagshipOrderVO.getPayableAmount() >= deliveryMinPrice) {
                // 自提
                DeliveryVO zt = new DeliveryVO();
                zt.setDeliverType(DeliveryType.USER_TRANSPORT);
                // 可以选择自提时间
                zt.setCanSelectFetchTime(true);

                // 同城
                // 前提：配送地址10公里范围内有门店，不能选择送达时间）/ 物流配送（可选择物流公司）
                DeliveryVO tc = new DeliveryVO();
                tc.setDeliverType(DeliveryType.STORE_TRANSPORT);
                // 可以预约
                tc.setCanReserve(true);
                tc.setIsReserve(false);
                // 本字段需要计算商品时效，根据时效显示
                tc.setArriveTime(new Timestamp(DateUtil.afterDays(5)));

                if (tc == null) {
                    // 物流配送
                    DeliveryVO wl = new DeliveryVO();
                    wl.setDeliverType(DeliveryType.THRID_TRANSPORT);
                    // 可选择的物流公司
                    wl.setOptionalExpresses(null);

                    optionalDeliveries.add(wl);
                }

                optionalDeliveries.add(zt);
                optionalDeliveries.add(tc);
            }
            // 不满起送金额
            else {
                // 自提
                DeliveryVO zt = new DeliveryVO();
                zt.setDeliverType(DeliveryType.USER_TRANSPORT);
                zt.setCanSelectFetchTime(true);
                zt.setCanSelectFetchTime(true);

                // 物流
                DeliveryVO wl = new DeliveryVO();
                wl.setDeliverType(DeliveryType.THRID_TRANSPORT);
                // 可选择的物流公司
                wl.setOptionalExpresses(null);

                optionalDeliveries.add(zt);
                optionalDeliveries.add(wl);
            }
        }
        return optionalDeliveries;
    }

    /**
     * 处理总店订单物流信息数据
     */
    private void handleFlagshipOrderDelivery() {
        // 获取门店起送价格，根据门店编号
        Integer deliveryMinPrice = helper.getDeliveryMinPriceByDepotCode(depot.getDepotCode());
        // 可选择的物流方式
        List<DeliveryVO> optionalDeliveries = this.getOptionalDeliveries(false, deliveryMinPrice);
        flagshipOrderVO.setOptionalDeliveries(optionalDeliveries);
        // 已选择的配送方式
        DeliveryVO selectedDelivery = flagshipOrderVO.getSelectedDelivery();
        // 如果用户没有选择配送方式，则设置第一个配送方式为默认配送
        if (selectedDelivery == null) {
            selectedDelivery = optionalDeliveries.get(0);
        }
        // 将用户请求的配送信息转化成订单配送数据
        OrderDeliveryInfoVO orderDeliveryInfoVO = OrderDeliveryInfoConvertor.selectedDeliveryVO2orderDeliveryInfoVO(selectedDelivery);
        if (flagshipOrderVO.getPayableAmount() >= deliveryMinPrice) {
            // 总店订单 && 达到起送金额
            // 同城配送 & 到店自提
            switch (selectedDelivery.getDeliverType()) {
                case STORE_TRANSPORT:
                    orderDeliveryInfoVO.setDeliveryMoney(0);
                    break;
                case USER_TRANSPORT:
                    orderDeliveryInfoVO.setDeliveryMoney(0);
                    break;
                default:
                    throw new BizSilentException(OrderException.NOT_SUPPORT_DELIVEY_TYPE);
            }
        } else {
            // 总店订单 && 不满起送金额
            // 到店自提 & 物流配送
            switch (selectedDelivery.getDeliverType()) {
                case USER_TRANSPORT:
                    orderDeliveryInfoVO.setDeliveryMoney(0);
                    break;
                case THRID_TRANSPORT:
                    // 物流配送,根据第三方物流收费方式计算费用
                    orderDeliveryInfoVO.setDeliveryMoney(22);
                    break;
                default:
                    throw new BizSilentException(OrderException.NOT_SUPPORT_DELIVEY_TYPE);
            }
        }
        flagshipOrderVO.setSelectedDelivery(selectedDelivery);
        flagshipOrderVO.setDelivery(orderDeliveryInfoVO);

    }

}
